package com.service.admin.order.controller;

import com.service.admin.framework.log.RequestLog;
import com.service.admin.order.controller.req.AddOrderHrComboPaddingReq;
import com.service.admin.order.controller.req.PageOrderHrComboPaddingReq;
import com.service.admin.order.service.OrderProductHrComboPaddingService;
import com.service.core.rest.BaseController;
import com.service.core.rest.response.BaseResponse;
import com.service.core.rest.response.CommonPageRep;
import com.service.dao.dto.rep.OrderProductHrComboPaddingRep;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description: 算力填充相关
 * @Author: ty
 * @Date: 2021/6/8 19:13
 * @param:
 * @return:
 **/
@RestController
@RequestMapping("order-product-hr-combo-padding")
@Api(value = "填充算力相关", tags = "填充算力相关 API", description = "填充算力相关 API")
public class OrderProductHrComboPaddingController extends BaseController {

    @Autowired
    private OrderProductHrComboPaddingService paddingService;

    @RequestLog("填充算力")
    @ApiOperation("填充算力")
    @PostMapping("padding")
    public BaseResponse padding(@ApiParam @RequestBody AddOrderHrComboPaddingReq paddingReq) {
        paddingService.addPaddingHashRate(paddingReq);
        return successBaseResponse();
    }

    @RequestLog("填充算力流水")
    @ApiOperation("填充算力流水")
    @PostMapping("memberPaddingList")
    public BaseResponse memberPaddingList(@RequestBody PageOrderHrComboPaddingReq pageOrderHrComboPaddingReq) {
        CommonPageRep<OrderProductHrComboPaddingRep> orderProductHrComboPaddingCommonPageRep = paddingService.memberPaddingList(pageOrderHrComboPaddingReq);
        return successQueryOneResponse(orderProductHrComboPaddingCommonPageRep);
    }
}
